package com.qzxy.premiumhotelsystem.service.impl;

import cn.dev33.satoken.stp.SaLoginModel;
import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qzxy.premiumhotelsystem.common.constant.UserRoleConstant;
import com.qzxy.premiumhotelsystem.domain.entity.Admin;
import com.qzxy.premiumhotelsystem.mapper.LogsMapper;
import com.qzxy.premiumhotelsystem.common.result.Result;
import com.qzxy.premiumhotelsystem.service.AdminService;
import com.qzxy.premiumhotelsystem.mapper.AdminMapper;
import com.qzxy.premiumhotelsystem.utils.Bcrypt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import static com.qzxy.premiumhotelsystem.config.SaTokenConfig.adminStpLogic;
import static com.qzxy.premiumhotelsystem.common.result.ResultCodeEnum.PASSWORD_ERROR;
import static com.qzxy.premiumhotelsystem.common.result.ResultCodeEnum.USERNAME_ERROR;

/**
* @author 14912
* @description 针对表【admin】的数据库操作Service实现
* @createDate 2024-09-12 15:55:14
*/
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin>
    implements AdminService{

    @Autowired
    private AdminMapper adminMapper;
    @Autowired
    private LogsMapper logsMapper;
    @Autowired
    private Bcrypt bcrypt;
    @Override
    public String login(Admin admin) {
        return adminMapper.login(admin);
    }

    @Override
    public Admin getByUsername(String username) {
        return adminMapper.getByUsername(username);
    }

}




